
var requests = require('../../requests/request.js');
var utils = require('../../utils/util.js');
//获取应用实例
var app = getApp()
Page({
  data: {
    testData:null,
    flag: false
  },
  onLoad: function (option) {
    var that = this;
    requests.requestStarttest(   //请求数据
      {test_id:option.id},(data) => {
        // console.log(data)
        that.setData({
          flag: true,
          testData:data
        })
      },() => {
        //请求失败
      },() => {
        //请求完成
      }
    )
  },
  //跳转到开始答题页
  toTestingPage:function(e){
    var id = e.currentTarget.dataset.id;
    var testType = e.currentTarget.dataset.type;
    // console.log(id)
    wx.navigateTo({
      url: '../testing/testing?id=' + id + '&type=' + testType
    })
  }
})